﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DualPlaneFR4Paster.Migrations
{
    public partial class changesomepropty : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "Alias",
                table: "XYZRPoints",
                type: "TEXT",
                maxLength: 64,
                nullable: true);

            migrationBuilder.CreateTable(
                name: "MParams",
                columns: table => new
                {
                    Id = table.Column<int>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    Name = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false),
                    Type = table.Column<string>(type: "TEXT", maxLength: 16, nullable: false),
                    Alias = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
                    Value = table.Column<string>(type: "TEXT", maxLength: 16, nullable: false),
                    Unit = table.Column<string>(type: "TEXT", maxLength: 16, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MParams", x => x.Id);
                });

            migrationBuilder.InsertData(
                table: "MParams",
                columns: new[] { "Id", "Alias", "Name", "Type", "Unit", "Value" },
                values: new object[] { 1, "Z1安全位", "Z1SafePos", "String", null, "20" });

            migrationBuilder.UpdateData(
                table: "XYZRPoints",
                keyColumn: "Id",
                keyValue: 1,
                column: "Alias",
                value: "初始点");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "MParams");

            migrationBuilder.DropColumn(
                name: "Alias",
                table: "XYZRPoints");
        }
    }
}
